<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        div {
            width: 200px;
            height: 200px;
            border: 1px solid #ccc;
        }
    </style>
</head>

<body>

    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <p>1123123123</p>
    <script src="js/public.js"></script>
    <script>
        var div = document.getElementsByTagName('div')
        for (var i = 0; i < div.length; i++) {
            if (i % 2 == 0) {
                div[i].style.backgroundColor = 'pink'
            } else {
                div[i].style.backgroundColor = 'skyblue'
            }
        }
        var p = $('p')
        console.log(p);
        p.style.color = 'red'
    </script>
</body>

</html>